<?php
/*
 * Created on 08.01.2007
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */

m2import('phpinchains/psp/Tag.php');

class cms_headincludesHandler extends phpinchains_psp_Tag
{

    /**
     * Is a body tag (if false, body is ignored)
     */
    var $tagType = PSP_EMPTY_TAG;
    /**
     * Tag name in form namespace:tagname
     */
    var $tagName   = 'cms:headincludes';

    var $attributes = array(
        'hoverButtons', // show buttons only on hover -> css classes xicsdummyelement und xicsbuttoncontainer have to be used
        'shortButtons'  // only on hovering visible buttons, all buttons for a content object are displayed
    );

    function doStartTag()
    {
        $is_editor = base_templateEngine_BuildModes::$EDITOR==base_ApplicationContext::getInstance()->getDocumentContext()->getBuildMode();
        if ($is_editor) {
            $this->out->write('
            ' . base_ApplicationContext::getInstance()->jQueryInclude() . '
            <link rel="stylesheet" type="text/css" href="' . base_ApplicationContext::getInstance()->mediaPath()->main() . 'js/loadmask/jquery.loadmask.css"/>
            <script type="text/javascript" src="' . base_ApplicationContext::getInstance()->mediaPath()->main() . 'js/jquery.loadmask.min.js"></script>
            <script type="text/javascript" src="' . base_ApplicationContext::getInstance()->mediaPath()->main() . 'js/jquery.scrollTo-1.4.2-min.js"></script>
            <script type="text/javascript" src="' . base_ApplicationContext::getInstance()->mediaPath()->main() . 'cms/editor.js"></script>
            <style type="text/css">
');
            $this->out->write('
                .xicstitle img, .xicsbuttons img {
                    border: 0;
                }
                .xicselement {
                    border: 1px solid transparent;
                    padding-left: 3px;
                    padding-right: 3px;
                }
                .xicselement:hover {
                    border:   1px solid silver;
                    position: relative;
                }
                .xicselement>.xicselementtitle {
                    font-size: 10px;
                    font-family: Helvetica,Arial;
                    visibility: hidden;
                }
                .xicselement:hover>.xicselementtitle {
                    visibility: visible;
                }
                .xicselement>.xicselementtitleblue {
                    background: #B8DBFF;
                    color: black;
                }
                .xicselement>.xicselementtitleorange {
                    background: #E9B602;
                    color: black;
                }
                .xicselement>.xicselementtitlered {
                    background: #FFB1B2;
                    color: black;
                }
                .xicstitle {
                    font-family: Helvetica, Arial;
                    font-size: 12px;
                    padding: 2px;
                    background-color: #f6f6f6;
                    border: 1px solid #dbdbdb;
                }
                .xicstitle form, .xicstitle img {
                    vertical-align: middle;
                }
                .xicstitle select {
                    color: black;
                    font-family: Helvetica, Arial;
                    font-size: 11px;
                    border: 2px solid #dbdbdb;
                    vertical-align: top;
                }
                .opaque {
                    opacity: 0.5;
                    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
                    filter: alpha(opacity=50);
                }
                .xicselementtitle {
                    position: relative;
                    padding: 0px;
                    /*height: 2px;
                    overflow: hidden;*/
                }
                /*.xicselementtitle>span {
                    display: none;
                }*/
                .xicselementtitle:hover {
                    height: auto;
                }
                .xicselementtitle:hover>span {
                    display: inline;
                }
                .xicsbuttonsinner a {
                    display:block;
                    width: 140px;
                    font-family: Helvetica, Arial;
                    font-size: 11px;
                    border: 1px solid #f6f6f6;
                    color: #595959;
                    text-decoration: none;
                    padding:2px;
                    margin-top: 2px;
                }
                .xicsbuttonsinner a img {
                    vertical-align: middle;
                }
                .xicsbuttonsinner a:hover {
                    border: 1px solid #dbdbdb;
                    color: black;
                }
                .xicsbuttonsinner, .xicsmovebuttons {
                    padding: 5px;
                    background-color: #f6f6f6;
                    border: 1px solid #dbdbdb;
                }
                .xicsbuttonsinner {
                    display: none;
                    position: absolute;
                }
                .xicsmovebuttons {
                    width: 16px;
                }
                a.xics-move-btn {
                    display: inline;
                    border: 0;
                    margin-right: 2px;
                    padding:0;
                }
                a.xics-move-btn:hover {
                    border: 0;
                }
                .xics-move-buttons {
                    margin-bottom: 5px;
                    padding-bottom: 5px;
                    border-bottom: 1px solid #dbdbdb;
                }
            </style>
            ');

        }
        return PSP_SKIP_BODY;
    }
    
    // In empty tag only necessary, if tag skips page, e.g. redirect -> no further processing needed
    function doEndTag()
    {
        //return PSP_SKIP_PAGE;
    }

}
?>